<template>
  <div>
    <div v-show="loading">
      <van-skeleton title :row="13"/>
    </div>
    <div class="nctouch-main-layout" v-show="!loading">
      <swiperheader :val="data[0]" v-on:commonId='todetail'></swiperheader>
      <hotclass :val="data[1]" v-on:commonId='todetail'></hotclass>
      <nctouch :val="data"  v-on:commonId='todetail'></nctouch>
      <memberCenter :val="data[9]" v-on:commonId='todetail'></memberCenter>
      <timelimit :val="data[11]" v-on:commonId='todetail'></timelimit>
      <brandwrap :val="data[14]" v-on:commonId='todetail'></brandwrap>
      <shopswiper :val="data[17]" v-on:commonId='todetail'></shopswiper>
      <solaImgWrap :val="data" v-on:commonId='todetail'></solaImgWrap>
      <shoplist :val="data[30]" v-on:commonId='todetail'></shoplist>
    </div>
  </div>
</template>
<script>
import Vue from 'vue';
import axios from 'axios'
import { Skeleton } from 'vant';

Vue.use(Skeleton);
import swiperheader from "@/index_recommend/swiper"
import hotclass from "@/index_recommend/hotClass"
import nctouch from "@/index_recommend/nctouchHome"
import memberCenter from "@/index_recommend/member_center"
import timelimit from "@/index_recommend/time_limit"
import brandwrap from "@/index_recommend/brandWrap"
import shopswiper from "@/index_recommend/shop_swiper"
import solaImgWrap from "@/index_recommend/solaImgWrap"
import shoplist from "@/index_recommend/shop_list"

export default {
  methods: {
    todetail(commonId){
      this.$emit('commonId',commonId)
    }
  },
  components:{
    swiperheader,
    hotclass,
    nctouch,
    memberCenter,
    timelimit,
    brandwrap,
    shopswiper,
    solaImgWrap,
    shoplist
  },
  data(){
    return{
      data:"",
      loading:true
    }
  },
  async mounted(){
    let val = ""
    val = await(axios('/special/special',{
        params:{
          specialId:1131,
          token:'&_=1594431436977'
          }
        })
        .then((data)=>{
            return data.data.datas.itemList
        })
        .catch((error)=>{
          return error
        })
        
    )
    this.loading=false
    this.data = val
  }
}
</script>
<style lang='stylus' scoped>
  .nctouch-main-layout
    margin-bottom 0.2rem

</style>